package com.ruoyi.exam.domain;

import com.ruoyi.common.utils.ObjectUtil;
import lombok.Data;

import java.util.Date;

/**
 * 理论考核
 */
@Data
public class ExamTheory {
    private Integer id;
    private Integer examId; // 考试ID
    private Integer paperId;    //试卷ID

    private Integer examTime;   //考试时长

    private Date createTime;
    private Date updateTime;

    public void setDefault(){
        createTime = new Date();
        updateTime = createTime;
    }


    public void verifyComplete(){
        ObjectUtil.checkNull(examId ,"examId");
        ObjectUtil.checkNull(paperId ,"paperId");

        if(examTime == null || examTime <= 0){
            throw new IllegalArgumentException("examTime["+ examTime +"] was empty");
        }
    }
}
